package com.mew.lobby.handler.login;

import com.mew.common.rest.bo.MewSession;
import com.mew.lobby.annotation.LobbyHandler;
import com.mew.lobby.message.request.EnterLobbyRequestMessage;
import com.mew.lobby.net.LobbyHandlerMapCmdType;
import com.mew.lobby.net.MewHandler;
import com.zebra.remoting.protocol.ZebraCommand;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
@Slf4j
@LobbyHandler(LobbyHandlerMapCmdType.LoginLobby)
public class LoginLobbyHandler implements MewHandler<EnterLobbyRequestMessage> {
    @Autowired
    private EnterLobbyService enterLobbyService;

    @Override
    public void handle(ZebraCommand<EnterLobbyRequestMessage> command, MewSession session) {
        log.info("handler login {}", command.toString());
        enterLobbyService.enterLobby(command, session);
    }


}
